package com.ccom.log.service;

import com.ccom.api.domain.SysLoginLog;
import com.ccom.api.domain.SysOperLog;
import com.ccom.api.feign.SysLogFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 异步调用日志服务
 */
@Service
public class AsyncLogService {

    @Autowired
    private SysLogFeign sysLogFeign;

    /**
     * 保存系统操作日志记录
     */
    @Async
    public void saveOperLog(SysOperLog sysOperLog) {
        sysLogFeign.saveOperLog(sysOperLog);
    }

    /**
     * 保存系统登录、退出日志记录
     */
    public void saveLoginLog(SysLoginLog sysLoginLog) {
        sysLogFeign.saveLoginLog(sysLoginLog);
    }
}
